package com.hospital.common;

/**
 * 用户角色常量
 *
 * @author Hospital Management System
 */
public class UserRole {

    /**
     * 患者
     */
    public static final Integer PATIENT = 1;

    /**
     * 医生
     */
    public static final Integer DOCTOR = 2;

    /**
     * 管理员
     */
    public static final Integer ADMIN = 3;

    /**
     * 获取角色名称
     */
    public static String getRoleName(Integer role) {
        switch (role) {
            case 1:
                return "患者";
            case 2:
                return "医生";
            case 3:
                return "管理员";
            default:
                return "未知角色";
        }
    }

    /**
     * 验证角色是否有效
     */
    public static boolean isValidRole(Integer role) {
        return role != null && (role == PATIENT || role == DOCTOR || role == ADMIN);
    }
} 